Skip to main content

Engine

ReactionalEngine

Via the Engine you have the opportunity to subscribe to delegates functions, that will trigger on events. This has an added benefit in that we can listen in on said communication, and also communicate directly with the various features, as a sort of low level API. The most common use case would be to listen for "noteon", and "noteoff" messages generated by the engine.


RouteNoteOn

  • Return Type: void

  • Summary: Subscribes to the callback for Note On events.

  • Description: Invoked when a "noteon" message is received from the Reactional Engine. This callback processes note-on events, providing details such as the event offset, sink index, lane index, pitch, and velocity.

  • Parameters:

  • offset (double): The time offset in microbeats when the event occurs.

  • sink (int): The sink index where the event originated.

  • lane (int): The lane or output group index.

  • pitch (float): The pitch of the note.

  • velocity (float): The velocity of the note.

  • Example:

    // Subscribe to the Note On event
    onNoteOn += RouteNoteOn;

    // Example callback implementation
    void RouteNoteOn(double offset, int sink, int lane, float pitch, float velocity)
    {
    // Do Stuff
    }

RouteNoteOff

  • Return Type: void

  • Summary: Subscribes to the callback for Note Off events.

  • Description: Invoked when a "noteoff" message is received from the Reactional Engine. This callback processes note-off events, providing details such as the event offset, sink index, lane index, pitch, and velocity.

  • Parameters:

  • offset (double): The time offset in microbeats when the event occurs.

  • sink (int): The sink index where the event originated.

  • lane (int): The lane or output group index.

  • pitch (float): The pitch of the note.

  • velocity (float): The velocity of the note.

  • Example:

    // Subscribe to the Note Off event
    onNoteOff += RouteNoteOff;

    // Example callback implementation
    void RouteNoteOff(double offset, int sink, int lane, float pitch, float velocity)
    {
    // Do Stuff
    }

RouteStingerEvent

  • Return Type: void

  • Summary: Subscribes to the callback for Stinger events.

  • Description: Invoked when a "stinger/start" or "stinger/stop" message is received from the Reactional Engine. This callback handles stinger events, providing the time offset, whether it's a start or stop event, and the stinger's origin.

  • Parameters:

  • offset (double): The time offset in microbeats when the event occurs.

  • startevent (bool): Indicates whether the event is a start or stop of the stinger.

  • stingerOrigin (int): The origin of the stinger event.

  • Example:

    // Subscribe to the Stinger event
    stingerEvent += RouteStingerEvent;

    // Example callback implementation
    void RouteStingerEvent(double offset, bool startevent, int stingerOrigin)
    {
    // Do Stuff
    }

RouteBarBeat

  • Return Type: void

  • Summary: Subscribes to the callback for Bar and Beat events.

  • Description: Invoked when a "bar" message is received from the Reactional Engine. This callback processes bar and beat events, providing the time offset, bar number, and beat number.

  • Parameters:

  • offset (double): The time offset in microbeats when the event occurs.

  • bar (int): The bar number in the current sequence.

  • beat (int): The beat number within the bar.

  • Example:

    // Subscribe to the Bar and Beat event
    onBarBeat += RouteBarBeat;

    // Example callback implementation
    void RouteBarBeat(double offset, int bar, int beat)
    {
    // Do Stuff
    }

RouteAudioEnd

  • Return Type: void

  • Summary: Subscribes to the callback for Audio End events.

  • Description: Invoked when an "audio/end" message is received from the Reactional Engine. This callback handles events that indicate the end of an audio sequence.

  • Parameters: None.

  • Example:

    // Subscribe to the Audio End event
    onAudioEnd += RouteAudioEnd;

    // Example callback implementation
    void RouteAudioEnd()
    {
    // Do Stuff
    }